package com.dmcloud.common.mybatis;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.Optional;

/**
 * Created by xiaodao
 * date: 2020/5/8
 */
public class Condition {
    public Condition() {
    }

    public static <T> IPage<T> getPage(Query query) {
        Page<T> page = new Page(Optional.ofNullable(query.getCurrentPage()).orElse(1).longValue(),
                Optional.ofNullable(query.getCurrentPage()).orElse(10).longValue());


        return page;
    }
}
